import request from '@/utils/request'

type ScoreparamsType = {
  subjectId?: number | string // 可选
  pageIndex: number
  pageSize: number
}

type ScoreResponseType = {
  id: number
  createTime: string
  userScore: string
  subjectName: string
  subjectId: number
  questionCount: number
  questionCorrect: number
  paperScore: string
  doTime: string
  paperType: number
  systemScore: string
  status: number
  paperName: string
  userName: string
}

type SubjectPageResponse = {
  total: number
  list: ScoreResponseType[]
}

interface ApiResponse<T> {
  code: number
  message: string
  response: T
}

export function subjectPage(data: ScoreparamsType) {
  return request.post<ApiResponse<SubjectPageResponse>>('/api/admin/examPaperAnswer/page', data)
}